<!DOCTYPE HTML>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>一洲货运有限公司-登录</title>
	<link rel="shortcut icon" href="images/logo.ico" />
	<script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="js/jquery.cookie.js"></script>
	<link rel="stylesheet" type="text/css" href="css/login-zice.style.css">
	<link rel="stylesheet" type="text/css" href="css/login-tipsy.css">
	<link rel="stylesheet" type="text/css" href="css/login-icon.css">
	<link rel="stylesheet" type="text/css" href="css/login-buttons.css">
	<link rel="stylesheet" type="text/css" href="css/default.css"/>
	<script type="text/javascript" src="js/iphone.check.js"></script>
	<script type="text/javascript" src="js/jquery-jrumble.js"></script>
	<script type="text/javascript" src="js/jquery.tipsy.js"></script>
	<script type="text/javascript" src="js/login.js"></script>
	<script type="text/javascript">
		if(top!=self){
			if(top.location != self.location)
			 top.location=self.location; 
		}
	</script>
<style type="text/css">
{
	background-image: none;
}

label.iPhoneCheckLabelOn span {
	padding-left: 0px
}

#versionBar {
	background-color: #212121;
	position: fixed;
	width: 100%;
	height: 35px;
	bottom: 0;
	left: 0;
	text-align: center;
	line-height: 35px;
	z-index: 11;
	-webkit-box-shadow: black 0px 10px 10px -10px inset;
	-moz-box-shadow: black 0px 10px 10px -10px inset;
	box-shadow: black 0px 10px 10px -10px inset;
}

.copyright {
	text-align: center;
	font-size: 10px;
	color: #CCC;
}

.copyright a {
	color: #A31F1A;
	text-decoration: none
}

/*update-begin--Author:tanghong  Date:20130419 for：【是否】按钮错位*/
.on_off_checkbox{
	width:0px;
}
/*update-end--Author:tanghong  Date:20130419 for：【是否】按钮错位*/
#login .logo {
	width: 500px;
	height: 51px;
}
#cap{
margin-left: 88px;
}
</style>

<script type="text/javascript">
        $(function () {
            $("#loginDialog").dialog({
                title: "系统登录",
                closable: false,
                modal: true,
                width: 400,
                height: 280,
                buttons: [{
                    id: "but_login",
                    text: "登 录",
                    //iconCls: "icon-ok",
                    handler: function () {
                        if ($("#loginFrm").form('validate')) {
                            $("#loginFrm").submit();
                        }
                    }
                }]
            });

            

            var url = location.href;
            //登录
            $("#loginFrm").form({
                url: 'ashx/bg_user_login.ashx',
                onSubmit: function (param) {
                    param.action = "login";
                    param.city = city;    //访问者所在城市
                    return checkInput();   //验证码是否正确
                },
                success: function (data) {
                    var result = eval('(' + data + ')');  //字符串转json
                    if (result.success) {
                        if (url.indexOf("ReturnUrl=") != -1) {
                            window.location.href = decodeURIComponent(url.substring(url.indexOf("ReturnUrl=") + 10));
                        }
                        else {
                            window.location.href = "index.html";
                        }
                    } else {
                        $.show_warning("提示", result.msg);
                        $('#but_login').linkbutton('enable');
                        createCode();   //刷新验证码
                        $("#captcha").val("");
                    }
                }
            })

            //回车提交表单
            $("#loginFrm").find('input').on('keyup', function (event) {
                if (event.keyCode == '13') {
                    //登录按钮如果处于禁用状态，那么回车也不提交表单
                    if (!($('#but_login').linkbutton("options").disabled) && $("#loginFrm").form('validate')) {
                        $("#loginFrm").submit();
                    }
                }
            })
            createCode();  //创建验证码
        })

        function getiflogin() {
            $.ajax({
                url: "ashx/bg_user_login.ashx",
                type: "post",
                dataType: "json",
                data: "action=iflogin&city=" + city,
                success: function (result) {
                    if (result.success) {
                        window.location.href = "index.html";
                    }
                },
                beforeSend: function () {
                    $('#but_login').linkbutton('disable');   //点击登陆后先禁用登录按钮，防止连击
                },
                complete: function () {
                    $('#but_login').linkbutton('enable');
                }
            });
        }

        //创建验证码
        var code;
        function createCode() {
            code = "";
            var codeLength = 4;     //验证码长度   
            var checkCode = document.getElementById("checkCode");
            var selectChar = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
            for (var i = 0; i < codeLength; i++) {
                var charIndex = Math.floor(Math.random() * 36);
                code += selectChar[charIndex];
            }
            if (checkCode) {
                checkCode.className = "code";
                checkCode.value = code;
                //$("#captcha").val(code);   //自动填写验证码
            }
        }

        //检查验证码
        function checkInput() {
            if ($.trim($("#captcha").val()) == "") {
                $("#msg").text("验证码不能为空");
                $("#msg").stop(true, true).animate({ opacity: "show" }, 300, function () {//.stop使动画达到末尾，否则连按回车一直显示隐藏
                    $("#msg").animate({ opacity: "hide" }, 2000);
                });
                $("#captcha").val("").focus();
                return false;
            }
            else if (document.getElementById("captcha").value.toUpperCase() != code) {
                $("#msg").text("验证码错误@_@！");
                $("#msg").stop(true, true).animate({ opacity: "show" }, 3000, function () {
                    $("#msg").animate({ opacity: "hide" }, 2000);
                });
                $("#captcha").val("").focus();
                createCode();       //刷新验证码
                return false;
            } else {
                $('#loginBtn').linkbutton('disable');
                return true;
            }
        }
    </script>

  </head>
  <body>
	<div id="alertMessage"></div>
	<div id="successLogin"></div>
	<div class="text_success">
		<img src="images/extend/loader_green.gif" alt="请稍后" /> <span>登陆成功!请稍后....</span>
	</div>
	<div id="login">
		<div class="ribbon" style="background-image:url(images/extend/typelogin.png);"></div>
		<div class="inner">
			<div class="logo">
				<img src="images/extend/toplogo.png" />
			</div>
			<div class="formLogin">
				<form name="formLogin" action="systemAction!load.action" id="formLogin" method="post">
					<input name="userKey" type="hidden" id="userKey" value="D1B5CC2FE46C4CC983C073BCA897935608D926CD32992B5900" />
					<div class="tip">
						<input class="userName" name="userName" type="text" id="userName" title="用户名" iscookie="true" value="" nullmsg="请输入用户名!" />
					</div>
					<div class="tip">
						<input class="password" name="password" type="password" id="password" title="密码" value="" nullmsg="请输入密码!" />
					</div>
					<div id="cap" class="tip">
						<input class="captcha" name="captcha" type="text" id="captcha" title="验证码" nullmsg="请输入验证码!" autocomplete="off" />
						<input type="text" onclick="createCode();$('#captcha').val('').focus();"
                        readonly="readonly" id="checkCode" class="unchanged" title="点击刷新验证码" style="width:70px;height:35px;margin-top: -10px;" align="absmiddle" id="captcha"/>
					</div>
					<div class="loginButton">
						<div style="float: left; margin-left: -9px;">
							<input type="checkbox" id="on_off" name="remember" checked="ture" class="on_off_checkbox" value="0" /> <span class="f_help">是否记住用户名?</span>
						</div>
						<div style="float: right; padding: 3px 0; margin-right: -12px;">
							<div>
								<ul class="uibutton-group">
									<li><a class="uibutton normal" href="index.html" id="but_login">登录</a>
									</li>
									<li><a class="uibutton normal" href="javascript:void(0);" id="forgetpass">重置</a>
									</li>
								</ul>
							</div>
						</div>
						
					</div>
				</form>
			</div>
		</div>
		<div class="shadow"></div>
	</div>
	<!--Login div-->
	<div class="clear"></div>
	<div id="versionBar">
		<div class="copyright"><span>版权归属一洲货运有限公司  2014   </span>
		</div>
	</div>
</body>
</html>
